From ad1f74192ab40866396316cd86bec3f98b6ef56b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 3 Nov 2009 08:40:40 +0000 Subject: [PATCH] vmx: Disable vPMU feature by default Signed-off-by: Shan Haitao --- xen/arch/x86/hvm/vmx/vpmu.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm/vmx/vpmu.c b/xen/arch/x86/hvm/vmx/vpmu.c index d9f1509754..2d457d3b73 100644 --- a/xen/arch/x86/hvm/vmx/vpmu.c +++ b/xen/arch/x86/hvm/vmx/vpmu.c @@ -31,6 +31,9 @@ #include #include +static int __read_mostly opt_vpmu_enabled; +boolean_param("vpmu", opt_vpmu_enabled); + int vpmu_do_wrmsr(struct cpu_user_regs *regs) { struct vpmu_struct *vpmu = vcpu_vpmu(current); @@ -79,6 +82,9 @@ void vpmu_initialise(struct vcpu *v) { struct vpmu_struct *vpmu = vcpu_vpmu(v); + if ( !opt_vpmu_enabled ) + return; + if ( vpmu->flags & VPMU_CONTEXT_ALLOCATED ) vpmu_destroy(v); -- 2.30.2